import React from 'react';
import { Pagination } from 'antd';
import Pts from 'prop-types'
const Paging = (props) => {
    // 切换页数和每页多少条数据的时候触发
    const ChangePage=(page,pagesize)=>{
        console.log('page:',page,'pagesize:',pagesize);
        props.setpage(page)
    }
    return (
        <div>
            <Pagination defaultCurrent={props.page} total={props.total} onChange={(page,pagesize)=>ChangePage(page,pagesize)}/>
        </div>
    );
}
//设置默认页数
Paging.defaultProps = {
    page:1
}
Paging.propType ={
    page:Pts.number.isRequired,
    total:Pts.number.isRequired
}


export default Paging;
